package org.JQbitorrentClinet.request.torrentmanagement;

import com.google.gson.reflect.TypeToken;
import lombok.Builder;
import org.JQbitorrentClinet.base.BaseGetParam;
import org.JQbitorrentClinet.pojo.torrent.TorrentInfo;

import java.util.List;

@Builder
public class GetTorrentListParam extends BaseGetParam {
    String filter;
    String category;
    String tag;
    String sort;
    Boolean reverse;
    Integer limit;
    Integer offset;
    String[] hashes;

    public GetTorrentListParam(String filter, String category, String tag, String sort, Boolean reverse, Integer limit, Integer offset, String[] hashes) {
        super();
        this.filter = filter;
        this.category = category;
        this.tag = tag;
        this.sort = sort;
        this.reverse = reverse;
        this.limit = limit;
        this.offset = offset;
        this.hashes = hashes;
        responseType = new TypeToken<List<TorrentInfo>>(){}.getType();;
    }

    @Override
    public String getApiUrl() {
        return "/api/v2/torrents/info";
    }
}
